package com.zyy.observer.demo02;

import java.util.Observable;

/**
 * @Description: 小偷   被观察者
 */
public class Thief extends Observable {
    private String name;

    public Thief(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void steal() {
        System.out.println("小偷" + this.getName() + "，偷东西了。。。");
        super.setChanged();
        super.notifyObservers();
    }
}
